package com.three.lab.bean;

import android.os.Parcel;
import android.os.Parcelable;

public class AddressBean implements Parcelable {

    private int id;
    private String name;
    private String phone;
    private String province;
    private int provinceCode;
    private String city;
    private int cityCode;
    private String area;
    private int areaCode;
    private String address;
    private String label;
    private boolean isDefault;

    public AddressBean() {
    }

    public AddressBean(int id, String name, String phone, String province, int provinceCode, String city, int cityCode, String area, int areaCode, String address, String label, boolean isDefault) {
        this.id = id;
        this.name = name;
        this.phone = phone;
        this.province = province;
        this.provinceCode = provinceCode;
        this.city = city;
        this.cityCode = cityCode;
        this.area = area;
        this.areaCode = areaCode;
        this.address = address;
        this.label = label;
        this.isDefault = isDefault;
    }

    protected AddressBean(Parcel in) {
        id = in.readInt();
        name = in.readString();
        phone = in.readString();
        province = in.readString();
        provinceCode = in.readInt();
        city = in.readString();
        cityCode = in.readInt();
        area = in.readString();
        areaCode = in.readInt();
        address = in.readString();
        label = in.readString();
        isDefault = in.readByte() != 0;
    }

    public static final Creator<AddressBean> CREATOR = new Creator<AddressBean>() {
        @Override
        public AddressBean createFromParcel(Parcel in) {
            return new AddressBean(in);
        }

        @Override
        public AddressBean[] newArray(int size) {
            return new AddressBean[size];
        }
    };

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public int getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(int provinceCode) {
        this.provinceCode = provinceCode;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public int getCityCode() {
        return cityCode;
    }

    public void setCityCode(int cityCode) {
        this.cityCode = cityCode;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public int getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(int areaCode) {
        this.areaCode = areaCode;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public boolean isDefault() {
        return isDefault;
    }

    public void setDefault(boolean aDefault) {
        isDefault = aDefault;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(name);
        dest.writeString(phone);
        dest.writeString(province);
        dest.writeInt(provinceCode);
        dest.writeString(city);
        dest.writeInt(cityCode);
        dest.writeString(area);
        dest.writeInt(areaCode);
        dest.writeString(address);
        dest.writeString(label);
        dest.writeByte((byte) (isDefault ? 1 : 0));
    }
}
